home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / interapplication comm / finderlaunch / testfinderlaunch.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  2.6 KB  |  107 lines

  1. /*    File:        TestFinderLaunch.h
  2.     
  3.     Description: 
  4.              A test application for sending an open documents Apple event to the
  5.             Finder.  This application calls the FinderLaunch routine defined
  6.             in FinderLaunch.c.
  7.  
  8.     Author:    John Montbriand
  9.  
  10.     Copyright: 
  11.             Copyright © 1999 by Apple Computer, Inc.
  12.             All rights reserved worldwide.
  13.     
  14.     Disclaimer:
  15.             You may incorporate this sample code into your applications without
  16.             restriction, though the sample code has been provided "AS IS" and the
  17.             responsibility for its operation is 100% yours.  However, what you are
  18.             not permitted to do is to redistribute the source as "DSC Sample Code"
  19.             after having made changes. If you're going to re-distribute the source,
  20.             we require that you make it clear in the source that the code was
  21.             descended from Apple Sample Code, but that you've made changes.
  22.     
  23.     Change History (most recent first):
  24.             9/13/99 created by John Montbriand
  25. */
  26.  
  27. #ifndef __TESTFINDERLAUNCH__
  28. #define __TESTFINDERLAUNCH__
  29.  
  30. #include <MacTypes.h>
  31. #include <Events.h>
  32.  
  33.     /* constants referring to the Apple menu */
  34. enum {
  35.     mApple = 128,
  36.     iAbout = 1,
  37.     iFirstAppleItem = 3
  38. };
  39.  
  40.     /* constants referring to the File menu */
  41. enum {
  42.     mFile = 129,
  43.     iSelectTargets = 1,
  44.     iQuit = 3
  45. };
  46.  
  47.     /* constants referring to the Edit menu */
  48. enum {
  49.     mEdit = 130,
  50.     iUndo = 1,
  51.     iCut = 3,
  52.     iCopy = 4,
  53.     iPaste = 5,
  54.     iClear = 6
  55. };
  56.  
  57.  
  58.     /* constants referring to the main STR# resource */
  59. enum {
  60.     kMainStrings = 128,
  61.     kNavTextMessage = 1
  62. };
  63.  
  64.     /* constants referring to the main dialog window */
  65. enum {
  66.     kMainDialog = 128,
  67.     kMainSelectButton = 1
  68.  
  69. };
  70.  
  71.     /* constants referring to the dialog resource used in the
  72.     call to CustomGetFile.  */
  73. enum {
  74.     kMySFDialog = 130,
  75.     kMySFSelectButton = 10
  76.  
  77. };
  78.  
  79.     /* constants referring to a number of error alerts. */
  80. enum {
  81.     kAboutBoxError = 130,
  82.     kProgramAbortedError = 131,
  83.     kSelectAbortedError = 132,
  84.     kReqMgrsNotAvailError = 133
  85. };
  86.  
  87.  
  88. /* routine prototypes */
  89.  
  90.  
  91. /* HandleNextEvent contains the application's event handling code.  When
  92.     called, the routine performs any processing required or the
  93.     event as it applies to the application. */
  94. void HandleNextEvent(EventRecord *ev);
  95.  
  96. /* ProcessNextEvent calls WaitNextEvent to get the next event and then it passes
  97.     the event along to the HandleNextEvent routine.  sleepTime is passed to the
  98.     WaitNextEvent routine in the sleep parameter. */
  99. void ProcessNextEvent(long sleepTime);
  100.  
  101. /* ParamAlert is a general alert handling routine.  If Apple events exist, then it
  102.     calls AEInteractWithUser to ensure the application is in the forground, and then
  103.     it displays an alert after passing the s1 and s2 parameters to ParamText. */
  104. short ParamAlert(short alertID, StringPtr s1, StringPtr s2);
  105.  
  106. #endif
  107.